home *** CD-ROM | disk | FTP | other *** search
-
-
-
- MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++)))) MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++))))
-
-
-
- NNNNAAAAMMMMEEEE
- manipulators - iostream out of band manipulations
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<iiiioooossssttttrrrreeeeaaaammmm....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<iiiioooommmmaaaannnniiiipppp....hhhh>>>>
-
- IIIIOOOOMMMMAAAANNNNIIIIPPPPddddeeeeccccllllaaaarrrreeee((((TTTT)))) ;;;;
-
- ccccllllaaaassssssss SSSSMMMMAAAANNNNIIIIPPPP((((TTTT)))) {{{{
- SSSSMMMMAAAANNNNIIIIPPPP((((TTTT))))(((( iiiioooossss&&&& ((((****))))((((iiiioooossss&&&&,,,,TTTT)))),,,, TTTT))));;;;
- ffffrrrriiiieeeennnndddd iiiissssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>((((iiiissssttttrrrreeeeaaaammmm&&&&,,,, SSSSMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- ffffrrrriiiieeeennnndddd oooossssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<((((oooossssttttrrrreeeeaaaammmm&&&&,,,, SSSSMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- }}}};;;;
- ccccllllaaaassssssss SSSSAAAAPPPPPPPP((((TTTT)))) {{{{
- SSSSAAAAPPPPPPPP((((TTTT))))(((( iiiioooossss&&&& ((((****))))((((iiiioooossss&&&&,,,,TTTT))))))));;;;
- SSSSMMMMAAAANNNNIIIIPPPP((((TTTT)))) ooooppppeeeerrrraaaattttoooorrrr(((())))((((TTTT))));;;;
- }}}};;;;
- ccccllllaaaassssssss IIIIMMMMAAAANNNNIIIIPPPP((((TTTT)))) {{{{
- IIIIMMMMAAAANNNNIIIIPPPP((((TTTT))))(((( iiiissssttttrrrreeeeaaaammmm&&&& ((((****))))((((iiiissssttttrrrreeeeaaaammmm&&&&,,,,TTTT)))),,,, TTTT))));;;;
- ffffrrrriiiieeeennnndddd iiiissssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>((((iiiissssttttrrrreeeeaaaammmm&&&&,,,, IIIIMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- }}}};;;;
- ccccllllaaaassssssss IIIIAAAAPPPPPPPP((((TTTT)))) {{{{
- IIIIAAAAPPPPPPPP((((TTTT))))(((( iiiissssttttrrrreeeeaaaammmm&&&& ((((****))))((((iiiissssttttrrrreeeeaaaammmm&&&&,,,,TTTT))))))));;;;
- IIIIMMMMAAAANNNNIIIIPPPP((((TTTT)))) ooooppppeeeerrrraaaattttoooorrrr(((())))((((TTTT))));;;;
- }}}};;;;
- ccccllllaaaassssssss OOOOMMMMAAAANNNNIIIIPPPP((((TTTT)))) {{{{
- OOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))(((( oooossssttttrrrreeeeaaaammmm&&&& ((((****))))((((oooossssttttrrrreeeeaaaammmm&&&&,,,,TTTT)))),,,, TTTT))));;;;
- ffffrrrriiiieeeennnndddd oooossssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<((((oooossssttttrrrreeeeaaaammmm&&&&,,,, OOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- }}}};;;;
- ccccllllaaaassssssss OOOOAAAAPPPPPPPP((((TTTT)))) {{{{
- OOOOAAAAPPPPPPPP((((TTTT))))(((( oooossssttttrrrreeeeaaaammmm&&&& ((((****))))((((oooossssttttrrrreeeeaaaammmm&&&&,,,,TTTT))))))));;;;
- OOOOMMMMAAAANNNNIIIIPPPP((((TTTT)))) ooooppppeeeerrrraaaattttoooorrrr(((())))((((TTTT))));;;;
- }}}};;;;
- ccccllllaaaassssssss IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT)))) {{{{
- IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))(((( iiiioooossssttttrrrreeeeaaaammmm&&&& ((((****))))((((iiiioooossssttttrrrreeeeaaaammmm&&&&,,,,TTTT)))),,,, TTTT))));;;;
- ffffrrrriiiieeeennnndddd iiiissssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr>>>>>>>>((((iiiioooossssttttrrrreeeeaaaammmm&&&&,,,, IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- ffffrrrriiiieeeennnndddd oooossssttttrrrreeeeaaaammmm&&&& ooooppppeeeerrrraaaattttoooorrrr<<<<<<<<((((iiiioooossssttttrrrreeeeaaaammmm&&&&,,,, IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))&&&&))));;;;
- }}}};;;;
- ccccllllaaaassssssss IIIIOOOOAAAAPPPPPPPP((((TTTT)))) {{{{
- IIIIOOOOAAAAPPPPPPPP((((TTTT))))(((( iiiioooossssttttrrrreeeeaaaammmm&&&& ((((****))))((((iiiioooossssttttrrrreeeeaaaammmm&&&&,,,,TTTT))))))));;;;
- IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT)))) ooooppppeeeerrrraaaattttoooorrrr(((())))((((TTTT))));;;;
- }}}};;;;
-
- IIIIOOOOMMMMAAAANNNNIIIIPPPPddddeeeeccccllllaaaarrrreeee((((iiiinnnntttt))));;;;
- IIIIOOOOMMMMAAAANNNNIIIIPPPPddddeeeeccccllllaaaarrrreeee((((lllloooonnnngggg))));;;;
-
- SSSSMMMMAAAANNNNIIIIPPPP((((lllloooonnnngggg)))) rrrreeeesssseeeettttiiiioooossssffffllllaaaaggggssss((((lllloooonnnngggg))));;;;
- SSSSMMMMAAAANNNNIIIIPPPP((((iiiinnnntttt)))) sssseeeettttffffiiiillllllll((((iiiinnnntttt))));;;;
- SSSSMMMMAAAANNNNIIIIPPPP((((lllloooonnnngggg)))) sssseeeettttiiiioooossssffffllllaaaaggggssss((((lllloooonnnngggg))));;;;
- SSSSMMMMAAAANNNNIIIIPPPP((((iiiinnnntttt)))) sssseeeettttpppprrrreeeecccciiiissssiiiioooonnnn((((iiiinnnntttt))));;;;
- SSSSMMMMAAAANNNNIIIIPPPP((((iiiinnnntttt)))) sssseeeettttwwww((((iiiinnnntttt wwww))));;;;
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++)))) MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++))))
-
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- Manipulators are values that may be "inserted into" or "extracted from"
- streams to achieve some effect (other than to insert or extract a value
- representation), with a convenient syntax. They enable one to embed a
- function call in an expression containing a series of insertions or
- extractions. For example, the predefined manipulator for ostreams,
- fffflllluuuusssshhhh, can be used as follows:
- ccccoooouuuutttt <<<<<<<< fffflllluuuusssshhhh
- to flush cout. Several iostream classes supply manipulators: see
- _i_o_s(_3_C++), _i_s_t_r_e_a_m(_3_C++), and _o_s_t_r_e_a_m(_3_C++). fffflllluuuusssshhhh is a simple
- manipulator; some manipulators take arguments, such as the predefined ios
- mmmmaaaannnniiiippppuuuullllaaaattttoooorrrrssss,,,, sssseeeettttffffiiiillllllll aaaannnndddd sssseeeettttwwww ((((sssseeeeeeee bbbbeeeelllloooowwww)))).... TTTThhhheeee hhhheeeeaaaaddddeeeerrrr ffffiiiilllleeee iiiioooommmmaaaannnniiiipppp....hhhh
- ssssuuuupppppppplllliiiieeeessss mmmmaaaaccccrrrroooo ddddeeeeffffiiiinnnniiiittttiiiioooonnnnssss wwwwhhhhiiiicccchhhh pppprrrrooooggggrrrraaaammmmmmmmeeeerrrrssss ccccaaaannnn uuuusssseeee ttttoooo ddddeeeeffffiiiinnnneeee nnnneeeewwww
- ppppaaaarrrraaaammmmeeeetttteeeerrrriiiizzzzeeeedddd mmmmaaaannnniiiippppuuuullllaaaattttoooorrrrssss....
-
- Ideally, the types relating to manipulators would be parameterized as
- "templates." The macros defined in iomanip.h are used to simulate
- templates. IIIIOOOOMMMMAAAANNNNIIIIPPPPddddeeeeccccllllaaaarrrreeee((((TTTT)))) declares the various classes and operators.
- (All code is declared inline so that no separate definitions are
- required.) Each of the other TTTTs is used to construct the real names and
- therefore must be a single identifier. Each of the other macros also
- requires an identifier and expands to a name.
-
- In the following descriptions, assume:
- - tttt is a TTTT, or type name.
- - ssss is an ios.
- - iiii is an istream.
- - oooo is an ostream.
- - iiiioooo is an iostream.
- - ffff is an ios& (*)(ios&).
- - iiiiffff is an istream& (*)(istream&).
- - ooooffff is an ostream& (*)(ostream&).
- - iiiiooooffff is an iostream& (*)(iostream&).
- - nnnn is an int....
- ---- llll iiiissss aaaa lllloooonnnngggg....
-
- ssss<<<<<<<<SSSSMMMMAAAANNNNIIIIPPPP((((TTTT))))((((ffff,,,,tttt))))
- ssss>>>>>>>>SSSSMMMMAAAANNNNIIIIPPPP((((TTTT))))((((ffff,,,,tttt))))
- ssss<<<<<<<<SSSSAAAAPPPPPPPP((((TTTT))))((((ffff))))((((tttt))))
- ssss>>>>>>>>SSSSAAAAPPPPPPPP((((TTTT))))((((ffff))))((((tttt))))
- Returns ffff((((ssss,,,,tttt)))), where ssss is the left operand of the insertion or extractor
- operator (i.e., ssss, iiii, oooo, or iiiioooo).
-
- iiii>>>>>>>>IIIIMMMMAAAANNNNIIIIPPPP((((TTTT))))((((iiiiffff,,,,tttt))))
- iiii>>>>>>>>IIIIAAAAPPPPPPPP((((TTTT))))((((iiiiffff))))((((tttt))))
- Returns iiiiffff((((iiii,,,,tttt)))).
-
- oooo<<<<<<<<OOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))((((ooooffff,,,,tttt))))
- oooo<<<<<<<<OOOOAAAAPPPPPPPP((((TTTT))))((((ooooffff))))((((tttt))))
- Returns ooooffff((((oooo,,,,tttt)))).
-
- iiiioooo<<<<<<<<IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))((((iiiiooooffff,,,,tttt))))
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++)))) MMMMAAAANNNNIIIIPPPP((((3333CCCC++++++++))))
-
-
-
- iiiioooo>>>>>>>>IIIIOOOOMMMMAAAANNNNIIIIPPPP((((TTTT))))((((iiiiooooffff,,,,tttt))))
- iiiioooo<<<<<<<<IIIIOOOOAAAAPPPPPPPP((((TTTT))))((((iiiiooooffff))))((((tttt))))
- iiiioooo>>>>>>>>IIIIOOOOAAAAPPPPPPPP((((TTTT))))((((iiiiooooffff))))((((tttt))))
- Returns iiiiooooffff((((iiiioooo,,,,tttt)))).
-
- iomanip.h contains two declarations, IOMANIPdeclare(int) and
- IOMANIPdeclare(long) and some manipulators that take an int or a long
- argument. These manipulators all have to do with changing the format
- state of a stream; see _i_o_s(_3_C++) for further details.
-
- oooo<<<<<<<<sssseeeettttwwww((((nnnn))))
- iiii>>>>>>>>sssseeeettttwwww((((nnnn))))
- Sets the field width of the stream (left-hand operand: oooo or iiii) to nnnn.
-
- oooo<<<<<<<<sssseeeettttffffiiiillllllll((((nnnn))))
- iiii>>>>>>>>sssseeeettttffffiiiillllllll((((nnnn))))
- Sets the fill character of the stream (oooo or iiii, or) to be nnnn.
-
- oooo<<<<<<<<sssseeeettttpppprrrreeeecccciiiissssiiiioooonnnn((((nnnn))))
- iiii>>>>>>>>sssseeeettttpppprrrreeeecccciiiissssiiiioooonnnn((((nnnn))))
- Sets the precision of the stream (oooo or iiii) to be nnnn.
-
- oooo<<<<<<<<sssseeeettttiiiioooossssffffllllaaaaggggssss((((llll))))
- iiii>>>>>>>>sssseeeettttiiiioooossssffffllllaaaaggggssss((((llll))))
- Turns on in the stream (oooo or iiii) the format flags marked in llll. (Calls
- oooo....sssseeeettttffff((((llll)))) or iiii....sssseeeettttffff((((llll))))).
-
- oooo<<<<<<<<rrrreeeesssseeeettttiiiioooossssffffllllaaaaggggssss((((llll))))
- iiii>>>>>>>>rrrreeeesssseeeettttiiiioooossssffffllllaaaaggggssss((((llll))))
- Clears in the stream (oooo or iiii) the format bits specified by llll. (Calls
- oooo....sssseeeettttffff((((0000,,,,llll)))) or iiii....sssseeeettttffff((((0000,,,,llll))))).
-
- CCCCAAAAVVVVEEEEAAAATTTTSSSS
- Syntax errors will be reported if IIIIOOOOMMMMAAAANNNNIIIIPPPPddddeeeeccccllllaaaarrrreeee((((TTTT)))) occurs more than once
- in a file with the same TTTT.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- ios(3C++), istream(3C++), ostream(3C++)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-